package com.itheima.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CheckGroupCheckItemDao {
    @Select("SELECT count(*) FROM t_checkgroup_checkitem where checkitem_id = #{id}")
    Integer getCheckGroupCountByCheckItemId(@Param("id") String id);


    @Select("SELECT checkitem_id FROM t_checkgroup_checkitem where checkgroup_id = #{id}")
    List<Integer> findCheckItemIdsByCheckGroupId(@Param("id") String id);

    int addRelation(@Param("checkGroupId") Integer checkGroupId, @Param("checkItemIds") List<String> checkItemIds);

    @Delete("delete from t_checkgroup_checkitem where checkgroup_id = #{id}")
    int deleteByCheckGroupId(String id);


}
